import { request } from "@/utils/service"

export interface VhuManAddAndUpdateProps {
    avatar: any
    nickname: string
    robot_id: number
    model_id: number
    info: string
    id?: number
}

/**
 * @param name 模型列表
 * @returns
 */
export const GetVHuManModelListApi = (data: { name?: string }) => {
    return request<any>({
        url: "/vhuman/model_list",
        method: "POST",
        data
    })
}

/**
 * @param data 添加数字人 / 修改数字人
 * @returns
 */
export const VHuManAddAndUpdateApi = (data: Partial<VhuManAddAndUpdateProps>, url: 'add' | 'update') => {
    return request<any>({
        url: `/vhuman/${url}`,
        method: "POST",
        data
    })
}

/**
 * @param id 删除智能体
 * @returns
 */
export const DeleteVHuManApi = (data: { id: number }) => {
    return request<any>({
        url: "/vhuman/del",
        method: "POST",
        data
    })
}

/**
 * @param page 获取数字人的列表
 * @returns
 */
export const GetVHuManListApi = (data: { page: number }) => {
    return request<any>({
        url: "/vhuman/list",
        method: "POST",
        data
    })
}